/**
 * TManMessage.java
 * ************************** 
 * @date May 5, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package gossipServices.gossipMessages;

import gossipServices.basic.nodeDescriptors.NodeDescriptor;

/**
 * Description: 
 *
 */
public class TManMessage extends GeneralGossipMessage {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	protected String tmanInstanceID;

	
	/**
	 * @param sender
	 * @param dest
	 * @param body
	 * @param gossipThread
	 */
	public TManMessage(NodeDescriptor sender, NodeDescriptor dest, Object body,
			Object gossipThread, String tmanInstanceID) {
		super(sender, dest, body, gossipThread);
		setTmanInstanceID(tmanInstanceID);
	}

	/**
	 * @param sender
	 * @param dest
	 */
	public TManMessage(NodeDescriptor sender, NodeDescriptor dest, String tmanInstanceID) {
		super(sender, dest);
		setTmanInstanceID(tmanInstanceID);
	}
	
	public String toString(){
		String ret = new String("");
		ret += super.toString()+"\n";
		ret += "Message: "+id+" "+sender+" "+dest+"\n";
		if(body != null)
			ret += body.toString();
		return ret;
	}
	
	public final String getTmanInstanceID() {
		return tmanInstanceID;
	}

	public final void setTmanInstanceID(String tmanInstanceID) {
		this.tmanInstanceID = tmanInstanceID;
	}

}
